//
//  UnityCaptureConnection.h
//  UnityCapture
//
//  Created by Adrian on 28.10.09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>

#import "UnityCaptureProtocols.h"
#import "QueueController.h"
#import "FrameMovieExporter.h"
#import "UnityCaptureConnection.h"

@interface UnityCaptureCore : NSObject {
	
	UnityCaptureConnection *connection;
	
	NSString *outputPath;
	ComponentInstance component;
	NSSize captureResolution;
	
	QueueController *frameQueueController;
	FrameMovieExporter *exporterObj;
	
	CGLContextObj context;
	unsigned playerWidth;
	unsigned playerHeight;
	unsigned captureWidth;
	unsigned captureHeight;
	
	BOOL isCapturing;
	BOOL waitForResolutionChangeToStartCapture;
	int framerate;
	float lastTime;
	float beginTime;
	long currentFrame;
	
	NSTimeInterval lastStatUpdate;
	int framesSinceLastStatUpdate;
}

- (id)initWithOpenWindow:(BOOL)open;
- (void)setCGLContext:(CGLContextObj)ctx withWidth:(int)width andHeight:(int)height;
- (void)openHelperWindow;
- (void)toggleCapture;

- (void)captureFrame:(float)time;

@end
